import QtQuick 1.1

Item
{
    MouseArea
    {
        id:drayRegion
        anchors.fill: parent
        acceptedButtons: Qt.LeftButton
        property double clickPosX: 0.0
        property double clickPosY: 0.0

        onPressed:
        {
            clickPosX = mouse.x;
            clickPosY = mouse.y;
        }
        onPositionChanged:
        {
            var delta = Qt.point(mouse.x-clickPosX,mouse.y-clickPosY)

            mainWindow.pos = Qt.point(mainWindow.pos.x+delta.x,mainWindow.pos.y+delta.y);
        }
    }

    id:root;
    width: 800;
    height: 480;

    //backgorund image
    Image
    {
        source: "qrc:/image/background.jpg";
    }

    //Close button
    Rectangle
    {
        id: closeBtn
        height: 24
        width: 24
        anchors.right: parent.right
        anchors.top: parent.top
        color: "#00000000"

        Image
        {
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            source: "qrc:/image/close.png";
        }

        MouseArea
        {

            anchors.fill: parent
            onClicked:
            {
                mainWindow.close();
            }
            onEntered:
            {
               closeBtn.opacity = 0.6;
            }
            onExited:
            {
                closeBtn.opacity = 1;
            }
        }
    }

    //Title
    Text
    {
        text: "Bing Best";
        font.pointSize: 11;

        font.family: "Microsoft YaHei";
        color: "#FFFFFFFF";
        anchors.top: parent.top

        anchors.horizontalCenter: parent.horizontalCenter;
    }

    //arrow
    Rectangle
    {

        height: 100
        width: 60
        anchors.horizontalCenter: parent.left
        anchors.verticalCenter: parent.verticalCenter

        MouseArea
        {
            onClicked:
            {

            }
        }

        Image
        {
            source: "qrc:/image/arrowLeft.png"
        }
    }

    Rectangle
    {
        height: 100
        width: 60
        anchors.horizontalCenter: parent.right
        anchors.verticalCenter: parent.verticalCenter

        MouseArea
        {
            onClicked:
            {

            }
        }


        Image
        {
            source: "qrc:/image/arrowRight.png"
        }
    }
}

